package com.runvp.service.biz.service.impl;

import com.runvp.common.core.text.Convert;
import com.runvp.common.utils.DateUtils;
import com.runvp.service.biz.domain.BizCustomerTranLog;
import com.runvp.service.biz.mapper.BizCustomerTranLogMapper;
import com.runvp.service.biz.service.IBizCustomerTranLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户资金记录Service业务层处理
 * 
 * @author runvp
 * @date 2022-11-05
 */
@Service
public class BizCustomerTranLogServiceImpl implements IBizCustomerTranLogService {
    @Autowired
    private BizCustomerTranLogMapper bizCustomerTranLogMapper;

    /**
     * 查询用户资金记录
     * 
     * @param id 用户资金记录主键
     * @return 用户资金记录
     */
    @Override
    public BizCustomerTranLog selectBizCustomerTranLogById(Long id) {
        return bizCustomerTranLogMapper.selectBizCustomerTranLogById(id);
    }

    /**
     * 查询用户资金记录列表
     * 
     * @param bizCustomerTranLog 用户资金记录
     * @return 用户资金记录
     */
    @Override
    public List<BizCustomerTranLog> selectBizCustomerTranLogList(BizCustomerTranLog bizCustomerTranLog) {
        return bizCustomerTranLogMapper.selectBizCustomerTranLogList(bizCustomerTranLog);
    }

    /**
     * 新增用户资金记录
     * 
     * @param bizCustomerTranLog 用户资金记录
     * @return 结果
     */
    @Override
    public int insertBizCustomerTranLog(BizCustomerTranLog bizCustomerTranLog) {
        bizCustomerTranLog.setCreateTime(DateUtils.getNowDate());
        return bizCustomerTranLogMapper.insertBizCustomerTranLog(bizCustomerTranLog);
    }

    /**
     * 修改用户资金记录
     * 
     * @param bizCustomerTranLog 用户资金记录
     * @return 结果
     */
    @Override
    public int updateBizCustomerTranLog(BizCustomerTranLog bizCustomerTranLog) {
        bizCustomerTranLog.setUpdateTime(DateUtils.getNowDate());
        return bizCustomerTranLogMapper.updateBizCustomerTranLog(bizCustomerTranLog);
    }

    /**
     * 批量删除用户资金记录
     * 
     * @param ids 需要删除的用户资金记录主键
     * @return 结果
     */
    @Override
    public int deleteBizCustomerTranLogByIds(String ids) {
        return bizCustomerTranLogMapper.deleteBizCustomerTranLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户资金记录信息
     * 
     * @param id 用户资金记录主键
     * @return 结果
     */
    @Override
    public int deleteBizCustomerTranLogById(Long id) {
        return bizCustomerTranLogMapper.deleteBizCustomerTranLogById(id);
    }
}
